//package com.aiou.security;
//
//import SmsUser;
//import SmsUserDetails;
//import SmsUserDetailsService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.authority.AuthorityUtils;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.social.security.SocialUser;
//import org.springframework.social.security.SocialUserDetails;
//import org.springframework.social.security.SocialUserDetailsService;
//import org.springframework.stereotype.Component;
//
///**
// * @author zyb
// */
//@Component
//@Slf4j
//public class MyUserDetailsServiceImpl implements UserDetailsService, SocialUserDetailsService, SmsUserDetailsService {
//    @Autowired
//    private PasswordEncoder passwordEncoder;
//
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//        log.info("登入用户名:{}", username);
//        // 根据用户名查找用户信息并判断是否被冻结
//        String password = passwordEncoder.encode("123456");
//        log.info("用户密码:{}", password);
//        return new User(username, password,
//                true, true, true, true,
//                AuthorityUtils.commaSeparatedStringToAuthorityList("admin,ROLE_USER"));
//    }
//
//    @Override
//    public SmsUserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException {
//        log.info("登入用户名:{}", mobile);
//        // 根据用户名查找用户信息并判断是否被冻结
//        String password = passwordEncoder.encode("123456");
//        log.info("用户密码:{}", password);
//        SmsUser user = new SmsUser(mobile, password,
//                true, true, true, true,
//                AuthorityUtils.commaSeparatedStringToAuthorityList("admin"));
//        user.setMobile(mobile);
//        return user;
//    }
//
//    @Override
//    public SocialUserDetails loadUserByUserId(String userId) throws UsernameNotFoundException {
//        log.info("登入用户名:{}", userId);
//        // 根据用户名查找用户信息并判断是否被冻结
//        String password = passwordEncoder.encode("123456");
//        log.info("用户密码:{}", password);
//        return new SocialUser(userId, password,
//                true, true, true, true,
//                AuthorityUtils.commaSeparatedStringToAuthorityList("admin,ROLE_USER"));
//    }
//}
